package v1

import (
	"github.com/gogf/gf/v2/frame/g"
)

type MiniPayReq struct {
	g.Meta      `path:"/minipay" tags:"微信支付" method:"post" summary:"小程序支付"`
	AppId       string `json:"appId" v:"required" description:"appid"`
	OutTradeNo  string `json:"outTradeNo" v:"required" description:"商户订单号"`
	Description string `json:"description" v:"required" description:"商品描述"`
	TotalFee    int64  `json:"totalFee" v:"required" description:"商品金额"`
	OpenId      string `json:"openId" v:"required" description:"openId"`
}
type MiniPayRes struct {
	g.Meta    `mime:"application/json"`
	AppId     *string `json:"appId"`
	TimeStamp *string `json:"timeStamp"`
	NonceStr  *string `json:"nonceStr"`
	Package   *string `json:"package"`
	PaySign   *string `json:"paySign"`
}

type RefundReq struct {
	g.Meta     `path:"/refund" tags:"微信支付" method:"post" summary:"退款"`
	AppId      string `json:"appId" v:"required" description:"appid"`
	OutTradeNo string `json:"outTradeNo" v:"required" description:"商户订单号"`
	TotalFee   int64  `json:"totalFee" v:"required" description:"退款金额"`
}
type RefundRes struct {
	g.Meta `mime:"application/json"`
	Status *string `json:"status"`
}

type QueryOrderReq struct {
	g.Meta     `path:"/orders" tags:"微信支付" method:"get" summary:"查询支付订单"`
	AppId      string `json:"appId" v:"required" description:"appid"`
	OutTradeNo string `json:"outTradeNo" description:"商户订单号"`
	OpenId     string `json:"openId" v:"required" description:"openId"`
}

type QueryOrderRes struct {
	g.Meta         `mime:"application/json"`
	TotalFee       *int64  `json:"totalFee" description:"商品金额"`
	Currency       *string `json:"currency"`
	Appid          *string `json:"appid"`
	Mchid          *string `json:"mchid"`
	OutTradeNo     *string `json:"out_trade_no"`
	Openid         *string `json:"openid"`
	TradeState     *string `json:"trade_state"`
	TradeStateDesc *string `json:"trade_state_desc"`
}
